<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // new Promise((resolve,reject)=>{
    //   resolve()
    //   console.log(123);
    // }).then((value)=>{
    //   console.log(value);
    // })
    // console.log('外部');

    new Promise((resolve, reject)=>{
      console.log('第一个promise');
      resolve('一')
    }).then(
      (value)=>{
        return new Promise((resolve, reject)=>{
          console.log(value+'-----第二个promise');
          reject('假装有参数')
        }).then(
          value =>{
            new Promise((resolve, reject)=>{
              console.log('第二个.then中的promise');
              resolve('第二个.then中的promise')
            })
          },
          reason =>{
            return new Promise((resolve, reject)=>{
              console.log(reason+'-----第二个.then中的promise');
              reject(reason+'----第二个.then中的promise')
            })
          }
        )
      },
      (reason)=>{
        console.log('失败了');
      }
    ).then(
      value =>{
        console.log(value+'成功了');
      },
      reason => {
        console.log(reason + '----shibaile');
        
      }
    )
    
  </script>
</body>
</html>